package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 车辆信息类型
 */
public enum Enum_CarDetailType {
    Scale_2_4("Scale_2_4", "2~4座"),
    Scale_5_7("Scale_5_7", "5~7座"),
    Scale_8_9("Scale_8_9", "8~9座"),
    Scale_10_12("Scale_10_12", "10~12座"),

    Scale_L1("Scale_L1", "5座车"),
    Scale_L2("Scale_L2", "7座车"),
    Scale_L3("Scale_L3", "9座车"),
    Scale_L4("Scale_L4", "12座车"),
    Scale_L5("Scale_L5", "12座车"),
    Scale_L6("Scale_L6", "12座车"),
    Scale_L7("Scale_L7", "12座车"),
    Scale_L8("Scale_L8", "12座车"),

    Type_Passenger("Type_Passenger", "客车"),
    Type_Bus("Type_Bus", "公交"),
    Type_Taxi("Type_Taxi", "出租车"),
    Type_Car("Type_Car", "轿车"),
    Type_Other("Type_Other", "其他")
    ;

    private String s;
    private String title;

    Enum_CarDetailType(String s, String title) {
        this.s = s;
        this.title = title;
    }
    Enum_CarDetailType(String s) {
        this.s = s;
        this.title = Enum_CarDetailType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_CarDetailType parseCode(String code) {
        switch (code) {
            case "Scale_2_4":
                return Scale_2_4;
            case "Scale_5_7":
                return Scale_5_7;
            case "Scale_8_9":
                return Scale_8_9;
            case "Scale_10_12":
                return Scale_10_12;

            case "Scale_L1":
                return Scale_L1;
            case "Scale_L2":
                return Scale_L2;
            case "Scale_L3":
                return Scale_L3;
            case "Scale_L5":
                return Scale_L5;
            case "Scale_L6":
                return Scale_L6;
            case "Scale_L7":
                return Scale_L7;
            case "Scale_L8":
                return Scale_L8;

            case "Type_Passenger":
                return Type_Passenger;
            case "Type_Bus":
                return Type_Bus;
            case "Type_Taxi":
                return Type_Taxi;
            case "Type_Car":
                return Type_Car;
            case "Type_Other":
                return Type_Other;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }


}
